import { createContext } from 'react';
import { decorate, observable } from 'mobx';

class MessageStore {
  refresh = 0;

  unReadNum = 0;

  setRefresh = () => {
    this.refresh += 1;
  }

  setUnReadNum = (num) => {
    this.unReadNum = num;
  }
}

decorate(MessageStore, {
  refresh: observable,
  unReadNum: observable
});

const messageStore = new MessageStore();
export {
  messageStore
};
export default createContext(messageStore);
